<?php

use Illuminate\Database\Seeder;

class GoodsTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        //
        $color = ['红','黄','白','黑','蓝','绿'];

        for ($i = 0; $i<180; $i++){
            DB::table('goods')->insert([
                'goods_name' => str_random(10),
                'goods_price' => rand(500,1000),
                'goods_img' => rand(1,100).".jpg",
                'goods_stock' => rand(0,1000),
                'is_sale' => rand(0,1),
                'is_best' => rand(0,1),
                'is_hot' => rand(0,1),
                'is_new' => rand(0,1),
                'cate_id' => rand(9,18),
                'brand_id' => rand(1,8),
                'goods_desc' => str_random(50),
                'sale_num' => rand(0,1000),
                'visit_num' => rand(0,1000),
                'appraise_num' => rand(0,1000),
                'goods_color' => $color[rand(0,5)],
                'goods_size' => rand(40,45),
                'created_at' => date('Y-m-d H:i:s'),
                'updated_at' => date('Y-m-d H:i:s'),
            ]);
        }
    }
}
